var t = getApp();

Page({
    data: {
        language: "",
        inputs: "",
        uids: [],
        memberInfo: {}
    },
    onLoad: function(t) {
        this.initData(), this.upToTop();
    },
    onReady: function() {
        var t = wx.getStorageSync("langIndex");
        this.setData({
            language: t.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    initData: function() {
        this.setData({
            uids: []
        });
    },
    upToTop: function() {
        this.setData({
            inputs: ""
        }), this.initData(), this.gotoSearch();
    },
    gotoSearch: function(a) {
        var i = this;
        if (!a && this.data.inputs && !this.data.uids.includes(this.data.inputs)) {
            var n = this.data.uids;
            n.push(this.data.inputs), this.setData({
                uids: n
            });
        }
        var s = t.getNetAddresss("plugin.distribution-order.api.controller.get-member-children");
        t._getNetWork({
            url: s,
            data: {
                uid: this.data.inputs
            },
            success: function(t) {
                var a = t.data;
                1 == a.result && i.setData({
                    memberInfo: a.data
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    goback: function() {
        if (this.data.uids.length > 0) {
            var t = this.data.uids;
            t.pop(), this.setData({
                uids: t
            }), this.data.uids.length > 0 ? this.setData({
                inputs: this.data.uids[this.data.uids.length - 1]
            }) : this.setData({
                inputs: ""
            }), this.data.inputs || this.setData({
                inputs: ""
            }), this.gotoSearch("no");
        }
    },
    inpbtn: function(t) {
        var a = t.detail.value;
        this.setData({
            inputs: a
        });
    },
    inpbtnclear: function() {
        this.setData({
            inputs: ""
        });
    },
    toNext: function(t) {
        var a = t.currentTarget.dataset.uid;
        this.setData({
            inputs: a
        }), this.gotoSearch();
    }
});